package AbstractFactory;

import AbstractFactory.Circle.Circle;
import AbstractFactory.Circle.Rectangle;
import AbstractFactory.Circle.Shape;
import AbstractFactory.Circle.Square;
import AbstractFactory.Color.Color;

/**
 * @Author: zhaojie
 * @Date: Created in 9:49 2018/6/26
 * @Description: 创建扩展了 AbstractFactory 的工厂类，基于给定的信息生成实体类的对象。
 */
public class ShapeFactory extends  AbstractFactory{
    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shapeType) {
        if(shapeType==null){
            return null;
        }else if(shapeType.equalsIgnoreCase("CIRCLE")){
            new Circle();
        }else if(shapeType.equalsIgnoreCase("SQUARE")){
            new Square();
        }else if(shapeType.equalsIgnoreCase("RECTANGLE")){
            new Rectangle();
        }
        return null;
    }
}
